import { BaseEntity } from '../../base/entity/base';
import { Column, Entity } from 'typeorm';



@Entity('product_item', {
    comment: '产品项'
})
export class ProductItemEntity extends BaseEntity {

    @Column({ comment: '产品项名称' })
    name: string

    @Column({ comment: '产品项价格' })
    price: number

    @Column({ comment: '产品项库存' })
    stock: number

    @Column({ comment: '产品项规格', type: 'json' })
    specs: {
        name: string; // 规格名称
        value: string; // 规格值
    }[]

    @Column({ comment: '产品项日期 不同的日期 价格及库存不一致', nullable: true })
    date?: Date

    @Column({ comment: '产品ID' })
    productId: number

}
